package com.redstar.interesting.common.starter.config;

import com.redstar.interesting.common.starter.intercepter.CustomerWebInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CustomerWebMvcConfig implements WebMvcConfigurer {


    private CustomerWebInterceptor customerWebInterceptor;


    @Autowired
    public void setCustomerInterceptor(CustomerWebInterceptor customerWebInterceptor){
        this.customerWebInterceptor = customerWebInterceptor;
    }


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(customerWebInterceptor).addPathPatterns("/**").excludePathPatterns("");
    }


}
